<template>
  <div>
    <h5>
      test.vue

    </h5>
    <el-container>
      <el-header>
        <!-- 1.组件名称 Breadcrumb -->
        <el-breadcrumb separator=">" style="margin-top: 15px;">
          <el-breadcrumb-item :to="{ path: '/elementUI' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item><a href="/elementUI">活动管理</a></el-breadcrumb-item>
          <el-breadcrumb-item>活动列表</el-breadcrumb-item>
          <el-breadcrumb-item>活动详情</el-breadcrumb-item>
        </el-breadcrumb>
      </el-header>
      <el-container>
        <el-aside>

        </el-aside>
        <el-main>

          <!-- 2.组件名称 Card -->
          <el-card class="box-card aaa">
            123
          </el-card>
        </el-main>
      </el-container>
    </el-container>


    <!-- 4.栅格  一行固定分为24份 -->
    <el-row gutter='10'>
      <!-- gutter栅格间的间隔 -->
      <el-col :span="8">
        <div class="div1">

          123
        </div>
      </el-col>
      <el-col :span="4">
        <div class="div2">

          123
        </div>
      </el-col>
      <el-col :span="8">
        <!-- 3.input -->
        <div style="margin-top: 15px;">
          <el-input placeholder="请输入内容" v-model="input3" class="input-with-select">
            <el-select v-model="select" slot="prepend" placeholder="请选择">
              <el-option label="餐厅名" value="1"></el-option>
              <el-option label="订单号" value="2"></el-option>
              <el-option label="用户电话" value="3"></el-option>
            </el-select>
            <el-button slot="append" icon="el-icon-search">搜索</el-button>
          </el-input>
        </div>
      </el-col>
    </el-row>


    <!-- 5.弹出框 dialog -->
    <el-button type="text" @click="dialogVisible = true">点击打开 Dialog</el-button>

    <el-dialog title="提示" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>

    <!-- 6.表单 -->
    <el-form ref="form" :model="addUser" label-width="80px">
      <el-form-item label="1用户名">
        <el-input v-model="addUser.username">
        </el-input>
      </el-form-item>
      <el-form-item label="epassword">

        <el-input v-model="addUser.password" type="password"></el-input>
      </el-form-item>

    </el-form>
    <el-row>
      <el-col :span="8">
        <!-- 7.导航栏-->
        <!-- 导航菜单默认为垂直模式，通过mode属性可以使导航菜单变更为水平模式 mode="horizontal"。
        另外，在菜单中通过submenu组件可以生成二级菜单。
        Menu 还提供了background-color、text-color和active-text-color，
        分别用于设置菜单的背景色、菜单的文字颜色和当前激活菜单的文字颜色。 
        -->
        <el-menu
              default-active="2"
              class="el-menu-vertical-demo"
              @open="handleOpen"
              @close="handleClose">
              <el-submenu index="1">
                <template slot="title">
                  <i class="el-icon-location"></i>
                  <span>导航一</span>
                </template>
                <el-menu-item-group>
                  <template slot="title">分组一</template>
                  <el-menu-item index="1-1">选项1</el-menu-item>
                  <el-menu-item index="1-2">选项2</el-menu-item>
                </el-menu-item-group>
                <el-menu-item-group title="分组2">
                  <el-menu-item index="1-3">选项3</el-menu-item>
                </el-menu-item-group>
                <el-submenu index="1-4">
                  <template slot="title">选项4</template>
                  <el-menu-item index="1-4-1">选项1</el-menu-item>
                </el-submenu>
              </el-submenu>
              <el-menu-item index="2">
                <i class="el-icon-menu"></i>
                <span slot="title">导航二</span>
              </el-menu-item>
              <el-menu-item index="3" disabled>
                <i class="el-icon-document"></i>
                <span slot="title">导航三</span>
              </el-menu-item>
              <el-menu-item index="4">
                <i class="el-icon-setting"></i>
                <span slot="title">导航四</span>
              </el-menu-item>
            </el-menu>

      </el-col>

    </el-row>


  </div>

</template>
<script>
  //这个vue文件就是一个组件 所以 在其内部定义组件 写法有所不同
  //export default 将组件交给VUE对象管理
  export default {
    data() {
      return {
        dialogVisible: false,
        select: '',
        input3: '',
        addUser: {
          username: '',
          password: ''
        }
      }
    },
    methods: {
      handleClose() {

      }
    }


  }
</script>
<style lang="less" scoped>
  .box-card {
    background-color: cadetblue;
    width: 480px;
  }
  .aaa{
    color: #DF5000;
  }

  .el-select .el-input {
    width: 130px;
  }

  .div1 {
    background-color: #DD4A68;
  }

  .div2 {
    background-color: #B3D4FC;
  }
</style>
